//
//  HEEnums.m
//  HealthElderly
//
//  Created by 吴欧 on 2020/10/28.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEEnums.h"


NSString * NSStringFromPayemntType(HEPayemntType state) {
  switch (state) {
    case HEPayemntTypeWxPay:
      return @"wechatpay";
    case HEPayemntTypeAliPay:
      return @"alipay";
    default:
      return nil;
  }
}

@implementation HEEnums

+ (NSString *)refundStatusToText:(NSInteger)status {
    NSArray *names = @[@" ", @"待处理", @"等待卖家确认退款", @"等待买家退货", @"等待卖家确认收货", @"退款中", @"已退款", @"已拒绝", @"已永久拒绝", @"取消售后"];
    return names[status];
}
+ (NSString *)welfareStatusToText:(NSInteger)status {
    switch (status) {
        case 0:
            return @"未开始";
        case 1:
            return @"待指派";
        case 2:
            return @"待接单";
        case 3:
            return @"待服务";
        case 4:
            return @"服务中";
        case 5:
            return @"待确认";
        case 6:
            return @"已完成";
        case 7:
            return @"已评价";
        case 11:
            return @"已取消";
        case 12:
            return @"开始出发";
        case 33:
            return @"已退款";
            
        default:
            break;
    }
    return @"";
}

+ (NSString *)orderStatusToText:(NSInteger)status {
    switch (status) {
        case 2:
            return @"待发货";
        case 3:
            return @"待收货";
        case 4:
            return @"待评价";
        case 5:
            return @"已完成";
        case 6:
            return @"售后中";
        case 13:
            return @"退款中";
        case 14:
            return @"已退款";
        case 15:
            return @"已关闭";
        case 16:
            return @"无效订单";
        case 17:
            return @"已删除";
        case 19:
            return @"待使用";
        case 20:
            return @"售后订单";
        case 21:
            return @"订单核销";
            
        default:
            break;
    }
    return @"";
}

+ (NSString *)logisticStatusToText:(NSString *)status {
    if ([@"2" isEqualToString:status]) {
        return @"运输中";
    }else if ([@"3" isEqualToString:status]) {
        return @"已签收";
    }
    return @"物流异常";
}

+ (HESysInfoType)sysInfoTypeToEnum:(NSString *)status {
    NSArray *items = @[@"us0001", @"us0002", @"sy0001", @"sy0002", @"sy0003", @"us0003", @"us0004", @"us0005", @"us0006", @"us0007", @"us0010", @"us0011", @"us0012", @"us0014"];
    NSInteger item = [items indexOfObject: status];
    return item;
}

+ (NSString *)sysInfoTypeToText:(NSString *)status {
    HESysInfoType type = [self sysInfoTypeToEnum: status];
    switch (type) {
          case HESysInfoTypeEXAM:// 体检报告
              return @"体检报告";
          case HESysInfoTypeKIT://检测报告
              return @"检测报告";
          case HESysInfoTypeSYSTEM://系统消息
              return @"系统消息";
          case HESysInfoTypeACTIVITY://活动
              return @"活动消息";
          case HESysInfoTypeSYS_NOTIFY://系统提醒
              return @"系统提醒";
          case HESysInfoTypeNOTIFY:// 用户提醒
              return @"用户提醒";
          case HESysInfoTypeEXPRESS://快递
              return @"快递";
          case HESysInfoTypeHEALTH://脊柱健康
              return @"脊柱健康";
          case HESysInfoTypeSUGGEST://投诉与建议
              return @"投诉与建议";
          case HESysInfoTypeDOCTOR://图文问诊消息
              return @"图文问诊";
          case HESysInfoTypeADD_NUM://加号付款
              return @"加号付款";
          case HESysInfoTypePLAN://健康规划单
              return @"健康规划";
          case HESysInfoTypeGUIDE://健康指导
              return @"健康指导";
          case HESysInfoTypeProxyPay://健康指导
              return @"请求代付";
      }
      return @"系统消息";
}

+ (NSString *)sexToText:(NSInteger)sex {
    switch (sex) {
        case 1:
            return @"男";
        case 2:
            return @"女";
            
        default:
            break;
    }
    return @"";
}

+ (NSInteger)sexToCode:(NSString *)text {
    if ([@"男" isEqualToString:text]) {
        return 1;
    }else if ([@"女" isEqualToString:text]) {
        return 2;
    }
    return 0;
}

+ (NSString *)activeGoodToText:(NSInteger)status {
    switch (status) {
        case 1:
            return @"指定分类";
        case 2:
            return @"部分服务";
        case 3:
            return @"全部服务";
        default:
            break;
    }
    return @"-";
}

+ (NSString *)teamStateToText:(NSInteger)status {
    switch (status) {
        case 0:
            return @"已过期";
        case 1:
            return @"使用中";
        case 2:
            return @"未支付";
        default:
            break;
    }
    return nil;
}

+ (NSString *)twStateToText:(NSInteger)status {
    switch (status) {
        case 0:
        case 1:
            return @"进行中";
        case 2:
            return @"已结束";
        case 3:
        case 5:
            return @"已转诊";
        default:
            break;
    }
    return nil;
}

+ (NSString *)visitUnitToText:(NSInteger)status {
    switch (status) {
        case 1:
            return @"天后";
        case 2:
            return @"周后";
        case 3:
            return @"月后";
        case 4:
            return @"年后";
        default:
            break;
    }
    return nil;
}

+ (NSString *)applyToText:(NSInteger)status {
    switch (status) {
        case 0:
            return @"已申请";
        case 1:
            return @"处理中";
        case 2:
            return @"已通过";
        case 3:
            return @"待付款";
        default:
            return @"已拒绝";
            break;
    }
    return nil;
}

+ (NSString *)indicatorsStateToText:(NSInteger)status {
    switch (status) {
        case 1:
            return @"偏低";
        case 2:
            return @"偏高";
        default:
            return @"正常";
            break;
    }
    return @"";
}


@end
